package com.sino.config.server.bean.acl;

import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Comment;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Table;

import com.sino.config.server.bean.Entity;

/**
 * 
 * @author nutz-matic
 * 
 */
@Table("t_user")
@Comment("用户")
public class User extends Entity {

	public static enum Status {
		ENABLED, DISABLED
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Name
	@Column("u_name")
	@Comment("用户名")
	private String name;

	@Column("u_password")
	@Comment("密码")
	@ColDefine(width = 32)
	private String password;

	@Column("u_status")
	@Comment("用户状态")
	private Status status = Status.ENABLED;

	/**
	 * @return the status
	 */
	public Status getStatus() {
		return status;
	}

	/**
	 * @param status
	 *            the status to set
	 */
	public void setStatus(Status status) {
		this.status = status;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return
	 */
	public boolean isAvailable() {
		return getStatus() == Status.ENABLED;
	}

}